using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._AnalysisTools._Proximity
{
    /// <summary>
    /// <para>Buffer</para>
    /// <para>Creates buffer polygons around input features to a specified distance.</para>
    /// <para>在输入要素周围创建指定距离的缓冲面。</para>
    /// </summary>    
    [DisplayName("Buffer")]
    public class Buffer : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public Buffer()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_in_features">
        /// <para>Input Features</para>
        /// <para>The input point, line, or polygon features to be buffered.</para>
        /// <para>要缓冲的输入点、线或面要素。</para>
        /// </param>
        /// <param name="_out_feature_class">
        /// <para>Output Feature Class</para>
        /// <para>The feature class containing the output buffers.</para>
        /// <para>包含输出缓冲区的要素类。</para>
        /// </param>
        /// <param name="_buffer_distance_or_field">
        /// <para>Distance [value or field]</para>
        /// <para><xdoc>
        ///   <para>The distance around the input features that will be buffered. Distances can be provided as either a value representing a linear distance or as a field from the input features that contains the distance to buffer each feature.</para>
        ///   <para>If linear units are not specified or are entered as Unknown, the linear unit of the input features' spatial reference is used.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>将缓冲的输入要素周围的距离。距离既可以作为表示线性距离的值提供，也可以作为输入要素的字段提供，其中包含要缓冲每个要素的距离。</para>
        ///   <para>如果未指定线性单位或输入为未知，则使用输入要素空间参考的线性单位。</para>
        /// </xdoc></para>
        /// </param>
        public Buffer(object _in_features, object _out_feature_class, object _buffer_distance_or_field)
        {
            this._in_features = _in_features;
            this._out_feature_class = _out_feature_class;
            this._buffer_distance_or_field = _buffer_distance_or_field;
        }
        public override string ToolboxName => "Analysis Tools";

        public override string ToolName => "Buffer";

        public override string CallName => "analysis.Buffer";

        public override List<string> AcceptEnvironments => ["MDomain", "MResolution", "MTolerance", "XYDomain", "XYResolution", "XYTolerance", "ZDomain", "ZResolution", "ZTolerance", "extent", "geographicTransformations", "outputCoordinateSystem", "outputMFlag", "outputZFlag", "outputZValue", "parallelProcessingFactor", "scratchWorkspace", "workspace"];

        public override object[] ParameterInfo => [_in_features, _out_feature_class, _buffer_distance_or_field, _line_side.GetGPValue(), _line_end_type.GetGPValue(), _dissolve_option.GetGPValue(), _dissolve_field, _method.GetGPValue()];

        /// <summary>
        /// <para>Input Features</para>
        /// <para>The input point, line, or polygon features to be buffered.</para>
        /// <para>要缓冲的输入点、线或面要素。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Features")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_features { get; set; }


        /// <summary>
        /// <para>Output Feature Class</para>
        /// <para>The feature class containing the output buffers.</para>
        /// <para>包含输出缓冲区的要素类。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output Feature Class")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _out_feature_class { get; set; }


        /// <summary>
        /// <para>Distance [value or field]</para>
        /// <para><xdoc>
        ///   <para>The distance around the input features that will be buffered. Distances can be provided as either a value representing a linear distance or as a field from the input features that contains the distance to buffer each feature.</para>
        ///   <para>If linear units are not specified or are entered as Unknown, the linear unit of the input features' spatial reference is used.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>将缓冲的输入要素周围的距离。距离既可以作为表示线性距离的值提供，也可以作为输入要素的字段提供，其中包含要缓冲每个要素的距离。</para>
        ///   <para>如果未指定线性单位或输入为未知，则使用输入要素空间参考的线性单位。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Distance [value or field]")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _buffer_distance_or_field { get; set; }


        /// <summary>
        /// <para>Side Type</para>
        /// <para><xdoc>
        ///   <para>Specifies the sides of the input features that will be buffered.</para>
        ///   <bulletList>
        ///     <bullet_item>Full—For line input features, buffers will be generated on both sides of the line. For polygon input features, buffers will be generated around the polygon and will contain and overlap the area of the input features. For point input features, buffers will be generated around the point. This is the default.</bullet_item><para/>
        ///     <bullet_item>Left—For line input features, buffers will be generated on the topological left of the line. This option is not valid for polygon input features.</bullet_item><para/>
        ///     <bullet_item>Right—For line input features, buffers will be generated on the topological right of the line. This option is not valid for polygon input features.</bullet_item><para/>
        ///     <bullet_item>Exclude the input polygon from buffer—For polygon input features, buffers will be generated outside the input polygon only (the area inside the input polygon will be erased from the output buffer). This option is not valid for line input features.</bullet_item><para/>
        ///   </bulletList>
        ///   <para>This optional parameter is not available with a Desktop Basic or Desktop Standard license.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定将缓冲的输入要素的边。</para>
        ///   <bulletList>
        ///     <bullet_item>完整—对于线输入要素，将在线的两侧生成缓冲区。对于面输入要素，将在面周围生成缓冲区，并将包含输入要素的区域并与之重叠。对于点输入要素，将在点周围生成缓冲区。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>左 - 对于线输入要素，将在线的拓扑左侧生成缓冲区。此选项对面输入要素无效。</bullet_item><para/>
        ///     <bullet_item>右 - 对于线输入要素，将在线的拓扑右侧生成缓冲区。此选项对面输入要素无效。</bullet_item><para/>
        ///     <bullet_item>从缓冲区中排除输入面 - 对于面输入要素，将仅在输入面外部生成缓冲区（输入面内的区域将从输出缓冲区中擦除）。此选项对线路输入要素无效。</bullet_item><para/>
        ///   </bulletList>
        ///   <para>此可选参数不适用于 Desktop Basic 或 Desktop Standard 许可证。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Side Type")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _line_side_value _line_side { get; set; } = _line_side_value._FULL;

        public enum _line_side_value
        {
            /// <summary>
            /// <para>Full</para>
            /// <para>Full—For line input features, buffers will be generated on both sides of the line. For polygon input features, buffers will be generated around the polygon and will contain and overlap the area of the input features. For point input features, buffers will be generated around the point. This is the default.</para>
            /// <para>完整—对于线输入要素，将在线的两侧生成缓冲区。对于面输入要素，将在面周围生成缓冲区，并将包含输入要素的区域并与之重叠。对于点输入要素，将在点周围生成缓冲区。这是默认设置。</para>
            /// </summary>
            [Description("Full")]
            [GPEnumValue("FULL")]
            _FULL,

            /// <summary>
            /// <para>Left</para>
            /// <para>Left—For line input features, buffers will be generated on the topological left of the line. This option is not valid for polygon input features.</para>
            /// <para>左 - 对于线输入要素，将在线的拓扑左侧生成缓冲区。此选项对面输入要素无效。</para>
            /// </summary>
            [Description("Left")]
            [GPEnumValue("LEFT")]
            _LEFT,

            /// <summary>
            /// <para>Right</para>
            /// <para>Right—For line input features, buffers will be generated on the topological right of the line. This option is not valid for polygon input features.</para>
            /// <para>右 - 对于线输入要素，将在线的拓扑右侧生成缓冲区。此选项对面输入要素无效。</para>
            /// </summary>
            [Description("Right")]
            [GPEnumValue("RIGHT")]
            _RIGHT,

            /// <summary>
            /// <para>Exclude the input polygon from buffer</para>
            /// <para>Exclude the input polygon from buffer—For polygon input features, buffers will be generated outside the input polygon only (the area inside the input polygon will be erased from the output buffer). This option is not valid for line input features.</para>
            /// <para>从缓冲区中排除输入面 - 对于面输入要素，将仅在输入面外部生成缓冲区（输入面内的区域将从输出缓冲区中擦除）。此选项对线路输入要素无效。</para>
            /// </summary>
            [Description("Exclude the input polygon from buffer")]
            [GPEnumValue("OUTSIDE_ONLY")]
            _OUTSIDE_ONLY,

        }

        /// <summary>
        /// <para>End Type</para>
        /// <para><xdoc>
        ///   <para>Specifies the shape of the buffer at the end of line input features. This parameter is not valid for polygon input features.</para>
        ///   <bulletList>
        ///     <bullet_item>Round—The ends of the buffer will be round, in the shape of a half circle. This is the default.</bullet_item><para/>
        ///     <bullet_item>Flat—The ends of the buffer will be flat, or squared, and will end at the endpoint of the input line feature.</bullet_item><para/>
        ///   </bulletList>
        ///   <para>This optional parameter is not available with a Desktop Basic or Desktop Standard license.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定行输入要素末尾缓冲区的形状。此参数对面输入要素无效。</para>
        ///   <bulletList>
        ///     <bullet_item>圆形—缓冲区的末端为圆形，呈半圆形状。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>平坦—缓冲区的端点为平整或平方，并将在输入线要素的端点处结束。</bullet_item><para/>
        ///   </bulletList>
        ///   <para>此可选参数不适用于 Desktop Basic 或 Desktop Standard 许可证。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("End Type")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _line_end_type_value _line_end_type { get; set; } = _line_end_type_value._ROUND;

        public enum _line_end_type_value
        {
            /// <summary>
            /// <para>Round</para>
            /// <para>Round—The ends of the buffer will be round, in the shape of a half circle. This is the default.</para>
            /// <para>圆形—缓冲区的末端为圆形，呈半圆形状。这是默认设置。</para>
            /// </summary>
            [Description("Round")]
            [GPEnumValue("ROUND")]
            _ROUND,

            /// <summary>
            /// <para>Flat</para>
            /// <para>Flat—The ends of the buffer will be flat, or squared, and will end at the endpoint of the input line feature.</para>
            /// <para>平坦—缓冲区的端点为平整或平方，并将在输入线要素的端点处结束。</para>
            /// </summary>
            [Description("Flat")]
            [GPEnumValue("FLAT")]
            _FLAT,

        }

        /// <summary>
        /// <para>Dissolve Type</para>
        /// <para><xdoc>
        ///   <para>Specifies the type of dissolve to be performed to remove buffer overlap.</para>
        ///   <bulletList>
        ///     <bullet_item>No Dissolve—An individual buffer for each feature will be maintained, regardless of overlap. This is the default.</bullet_item><para/>
        ///     <bullet_item>Dissolve all output features into a single feature—All buffers will be dissolved together into a single feature, removing any overlap.</bullet_item><para/>
        ///     <bullet_item>Dissolve features using the listed fields' unique values or combination of values—Any buffers sharing attribute values in the listed fields (carried over from the input features) will be dissolved.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定为消除缓冲区重叠而要执行的融合类型。</para>
        ///   <bulletList>
        ///     <bullet_item>无融合 - 无论是否重叠，都将保留每个要素的单独缓冲区。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>将所有输出要素融合为单个要素 - 所有缓冲区将一起融合为单个要素，从而消除任何重叠。</bullet_item><para/>
        ///     <bullet_item>使用所列字段的唯一值或值组合来溶解要素 - 将溶解所列字段中共享属性值（从输入要素继承而来）的任何缓冲区。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Dissolve Type")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _dissolve_option_value _dissolve_option { get; set; } = _dissolve_option_value._NONE;

        public enum _dissolve_option_value
        {
            /// <summary>
            /// <para>No Dissolve</para>
            /// <para>No Dissolve—An individual buffer for each feature will be maintained, regardless of overlap. This is the default.</para>
            /// <para>无融合 - 无论是否重叠，都将保留每个要素的单独缓冲区。这是默认设置。</para>
            /// </summary>
            [Description("No Dissolve")]
            [GPEnumValue("NONE")]
            _NONE,

            /// <summary>
            /// <para>Dissolve all output features into a single feature</para>
            /// <para>Dissolve all output features into a single feature—All buffers will be dissolved together into a single feature, removing any overlap.</para>
            /// <para>将所有输出要素融合为单个要素 - 所有缓冲区将一起融合为单个要素，从而消除任何重叠。</para>
            /// </summary>
            [Description("Dissolve all output features into a single feature")]
            [GPEnumValue("ALL")]
            _ALL,

            /// <summary>
            /// <para>Dissolve features using the listed fields' unique values or combination of values</para>
            /// <para>Dissolve features using the listed fields' unique values or combination of values—Any buffers sharing attribute values in the listed fields (carried over from the input features) will be dissolved.</para>
            /// <para>使用所列字段的唯一值或值组合来溶解要素 - 将溶解所列字段中共享属性值（从输入要素继承而来）的任何缓冲区。</para>
            /// </summary>
            [Description("Dissolve features using the listed fields' unique values or combination of values")]
            [GPEnumValue("LIST")]
            _LIST,

        }

        /// <summary>
        /// <para>Dissolve Field(s)</para>
        /// <para><xdoc>
        ///   <para>The list of fields from the input features on which the output buffers will be dissolved. Any buffers sharing attribute values in the listed fields (carried over from the input features) will be dissolved.</para>
        ///   <para>The Add Field button, which is only used in ModelBuilder, allows you to add expected fields to the Dissolve Field(s) list.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>输入要素中将在其上溶解输出缓冲区的字段列表。将解散所有字段中共享属性值的任何缓冲区（从输入要素继承而来）。</para>
        ///   <para>添加字段按钮（仅在模型构建器中使用）可用于将预期字段添加到“融合字段”列表中。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Dissolve Field(s)")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public List<object> _dissolve_field { get; set; } = null;


        /// <summary>
        /// <para>Method</para>
        /// <para><xdoc>
        ///   <para>Specifies the method to use, planar or geodesic, to create the buffer.</para>
        ///   <bulletList>
        ///     <bullet_item>Planar—If the input features are in a projected coordinate system, Euclidean buffers will be created. If the input features are in a geographic coordinate system and the buffer distance is in linear units (meters, feet, and so forth, as opposed to angular units such as degrees), geodesic buffers will be created. This is the default. You can use the Output Coordinate System environment setting to specify the coordinate system to use. For example, if your input features are in a projected coordinate system, you can set the environment to a geographic coordinate system to create geodesic buffers.</bullet_item><para/>
        ///     <bullet_item>Geodesic (shape preserving)—All buffers will be created using a shape-preserving geodesic buffer method, regardless of the input coordinate system.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定用于创建缓冲区的方法（平面或测地线）。</para>
        ///   <bulletList>
        ///     <bullet_item>平面 - 如果输入要素位于投影坐标系中，则将创建欧几里得缓冲区。如果输入要素位于地理坐标系中，并且缓冲区距离采用线性单位（米、英尺等，而不是角度单位（如度），则将创建测地线缓冲区。这是默认设置。可以使用输出坐标系环境设置来指定要使用的坐标系。例如，如果输入要素位于投影坐标系中，则可以将环境设置为地理坐标系以创建测地线缓冲区。</bullet_item><para/>
        ///     <bullet_item>测地线（形状保留）—无论输入坐标系如何，都将使用形状保留测地线缓冲区方法创建所有缓冲区。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Method")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _method_value _method { get; set; } = _method_value._PLANAR;

        public enum _method_value
        {
            /// <summary>
            /// <para>Geodesic (shape preserving)</para>
            /// <para>Geodesic (shape preserving)—All buffers will be created using a shape-preserving geodesic buffer method, regardless of the input coordinate system.</para>
            /// <para>测地线（形状保留）—无论输入坐标系如何，都将使用形状保留测地线缓冲区方法创建所有缓冲区。</para>
            /// </summary>
            [Description("Geodesic (shape preserving)")]
            [GPEnumValue("GEODESIC")]
            _GEODESIC,

            /// <summary>
            /// <para>Planar</para>
            /// <para>Planar—If the input features are in a projected coordinate system, Euclidean buffers will be created. If the input features are in a geographic coordinate system and the buffer distance is in linear units (meters, feet, and so forth, as opposed to angular units such as degrees), geodesic buffers will be created. This is the default. You can use the Output Coordinate System environment setting to specify the coordinate system to use. For example, if your input features are in a projected coordinate system, you can set the environment to a geographic coordinate system to create geodesic buffers.</para>
            /// <para>平面 - 如果输入要素位于投影坐标系中，则将创建欧几里得缓冲区。如果输入要素位于地理坐标系中，并且缓冲区距离采用线性单位（米、英尺等，而不是角度单位（如度），则将创建测地线缓冲区。这是默认设置。可以使用输出坐标系环境设置来指定要使用的坐标系。例如，如果输入要素位于投影坐标系中，则可以将环境设置为地理坐标系以创建测地线缓冲区。</para>
            /// </summary>
            [Description("Planar")]
            [GPEnumValue("PLANAR")]
            _PLANAR,

        }

        public Buffer SetEnv(object MDomain = null, object MResolution = null, object MTolerance = null, object XYDomain = null, object XYResolution = null, object XYTolerance = null, object ZDomain = null, object ZResolution = null, object ZTolerance = null, object extent = null, object geographicTransformations = null, object outputCoordinateSystem = null, object outputMFlag = null, object outputZFlag = null, object outputZValue = null, object parallelProcessingFactor = null, object scratchWorkspace = null, object workspace = null)
        {
            base.SetEnv(MDomain: MDomain, MResolution: MResolution, MTolerance: MTolerance, XYDomain: XYDomain, XYResolution: XYResolution, XYTolerance: XYTolerance, ZDomain: ZDomain, ZResolution: ZResolution, ZTolerance: ZTolerance, extent: extent, geographicTransformations: geographicTransformations, outputCoordinateSystem: outputCoordinateSystem, outputMFlag: outputMFlag, outputZFlag: outputZFlag, outputZValue: outputZValue, parallelProcessingFactor: parallelProcessingFactor, scratchWorkspace: scratchWorkspace, workspace: workspace);
            return this;
        }

    }

}